<?php

namespace App\Admin\Actions\Goods;

use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;


class ContentClearTopping extends RowAction
{

    public $name = '取消置顶';

    /**
     * @param Model $model
     * @return string
     */
    public function handle(Model $model)
    {
        $model->is_remord = 0;
        $model->save();
        return $this->response()->success('操作成功')->refresh();
    }

    /**
     * @param $star
     * @return string
     */
    public function display($id)
    {
        return '<button type="button" class="btn btn-xs btn-flat btn-warning" >取消置顶</button>';
    }

    public function dialog()
    {
        $this->confirm('确定取消置顶吗？');
    }

}